﻿using System;
using System.ServiceProcess;

namespace DbToPbiSvc
{
    partial class ProjectInstaller
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        private string username = string.Empty;
        private string password = string.Empty;

        /// <summary> 
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            components = new System.ComponentModel.Container();
        }

        protected override void OnBeforeInstall(System.Collections.IDictionary savedState)
        {
            base.OnBeforeInstall(savedState);

            try
            {

                System.Diagnostics.EventLog.WriteEntry("DbToPbiSvc.Setup", "OnBeforeInstall - IN");
                System.Diagnostics.EventLog.WriteEntry("DbToPbiSvc.Setup", "OnBeforeInstall - System account will be used.");

                process.Account = ServiceAccount.LocalSystem;

            }
            catch (Exception exc)
            {
                System.Diagnostics.EventLog.WriteEntry("DbToPbiSvc.Setup", exc.Message);
            }
            finally
            {
                System.Diagnostics.EventLog.WriteEntry("DbToPbiSvc.Setup", "OnBeforeInstall - OUT");
            }
        }
        #endregion
    }
}